package vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult implements Serializable {
    private String code;
    private String message;
    private Object data;

    public static String AJAX_CODE_SUCCESS="200";
    public static String AJAX_CODE_EXCEPTION="500";



    public static AjaxResult success(){
        return success("OK");
    }

    public static AjaxResult success(String message){
        return success(message,null);
    }

    public static AjaxResult success(String message,Object data){
        return new AjaxResult(AJAX_CODE_SUCCESS,message,data);
    }

}
